﻿namespace Comdiv.QWeb.Utils.LogicalExpressionLanguage {
	public class LogicalExpressionEvaluator {
		private readonly LogicalExpressionParser parser;
		private readonly ILogicTermSource source;

		public LogicalExpressionEvaluator(ILogicTermSource source) {
			this.source = source;
			parser = new LogicalExpressionParser();
		}

		public bool eval(string expression) {
			var parsedexpression = parser.Parse(expression);
			return parsedexpression.Eval(source);
		}
	}
}